IsEmpty - returns true when stack is empty otherwise returns false.
Common terminology for a queue is
Queues follow these concepts:
FIFO: First In First Out: This means that the first item in the queue will be the first item out of the queue.
Dequeue O(1) When you remove an item from a queue, you use the dequeue action. This is done with an O(1) operation in time because it doesn’t matter how many other items are in the queue, you are always just removing the front Node of the queue.
Peek O(1) : When conducting a peek, you will only be inspecting the front Node of the queue.
Typically, you want to check isEmpty before conducting a peek. This will ensure that an exception is not raised. Alternately, you can wrap the call in a try/catch block.
IsEmpty O(1) Here is the pseudocode for isEmpty
ALGORITHM isEmpty()
// INPUT <-- none
// OUTPUT <-- boolean
return front = NULL